﻿namespace WLFramework
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    public class Shield
    {
        public static void AssertNotNull<T>(ref T input, string name = "input")
        {
            if (input == null)
            {
                throw new ArgumentNullException(name);
            }
        }

        public static void AssertNotNullOrEmpty(ref string input, string name = "input")
        {
            if (string.IsNullOrEmpty(input))
            {
                throw new ArgumentNullException(name);
            }
        }

        public static void AssertIsTrue(bool value, string name = "value")
        {
            if (!value)
            {
                throw new ArgumentException(name);
            }
        }

        public static void AssertIsNotTrue(bool value, string name = "value")
        {
            if (value)
            {
                throw new ArgumentException(name);
            }
        }
    }
}
